home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12585 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 2e 63 61 69 73 2e |Path: ne|ws.cais.|
|00000010| 63 6f 6d 21 6e 65 77 73 | 0a 46 72 6f 6d 3a 20 6d |com!news|.From: m|
|00000020| 61 74 74 68 65 77 40 69 | 61 70 70 73 2e 63 6f 6d |atthew@i|apps.com|
|00000030| 20 28 4d 61 74 74 68 65 | 77 20 42 61 69 72 64 29 | (Matthe|w Baird)|
|00000040| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 63 6f 6d |.Newsgro|ups: com|
|00000050| 70 2e 6c 61 6e 67 2e 63 | 2b 2b 0a 53 75 62 6a 65 |p.lang.c|++.Subje|
|00000060| 63 74 3a 20 4f 44 42 43 | 20 53 51 4c 20 70 72 6f |ct: ODBC| SQL pro|
|00000070| 62 6c 65 6d 73 0a 44 61 | 74 65 3a 20 32 30 20 4d |blems.Da|te: 20 M|
|00000080| 61 72 20 31 39 39 36 20 | 31 38 3a 32 35 3a 32 35 |ar 1996 |18:25:25|
|00000090| 20 47 4d 54 0a 4f 72 67 | 61 6e 69 7a 61 74 69 6f | GMT.Org|anizatio|
|000000a0| 6e 3a 20 49 61 70 70 73 | 0a 4d 65 73 73 61 67 65 |n: Iapps|.Message|
|000000b0| 2d 49 44 3a 20 3c 34 69 | 70 69 69 6c 24 33 6a 38 |-ID: <4i|piil$3j8|
|000000c0| 40 6e 65 77 73 2e 63 61 | 69 73 2e 63 6f 6d 3e 0a |@news.ca|is.com>.|
|000000d0| 52 65 70 6c 79 2d 54 6f | 3a 20 4d 61 74 74 68 65 |Reply-To|: Matthe|
|000000e0| 77 40 69 61 70 70 73 2e | 63 6f 6d 0a 4e 4e 54 50 |w@iapps.|com.NNTP|
|000000f0| 2d 50 6f 73 74 69 6e 67 | 2d 48 6f 73 74 3a 20 77 |-Posting|-Host: w|
|00000100| 61 74 65 72 6c 6f 6f 2e | 69 61 70 70 73 2e 63 6f |aterloo.|iapps.co|
|00000110| 6d 0a 4d 69 6d 65 2d 56 | 65 72 73 69 6f 6e 3a 20 |m.Mime-V|ersion: |
|00000120| 31 2e 30 0a 43 6f 6e 74 | 65 6e 74 2d 54 79 70 65 |1.0.Cont|ent-Type|
|00000130| 3a 20 54 65 78 74 2f 50 | 6c 61 69 6e 3b 20 63 68 |: Text/P|lain; ch|
|00000140| 61 72 73 65 74 3d 55 53 | 2d 41 53 43 49 49 0a 58 |arset=US|-ASCII.X|
|00000150| 2d 4e 65 77 73 72 65 61 | 64 65 72 3a 20 57 69 6e |-Newsrea|der: Win|
|00000160| 56 4e 20 30 2e 39 39 2e | 36 0a 0a 49 27 76 65 20 |VN 0.99.|6..I've |
|00000170| 77 72 69 74 74 65 6e 20 | 61 6e 20 61 70 70 6c 69 |written |an appli|
|00000180| 63 61 74 69 6f 6e 20 74 | 68 61 74 20 61 6c 6c 6f |cation t|hat allo|
|00000190| 77 73 20 74 68 65 20 75 | 73 65 72 20 74 6f 20 70 |ws the u|ser to p|
|000001a0| 61 73 73 20 53 51 4c 20 | 71 75 65 72 69 65 73 20 |ass SQL |queries |
|000001b0| 74 6f 20 61 6e 20 0a 4f | 44 42 43 20 64 61 74 61 |to an .O|DBC data|
|000001c0| 73 6f 75 72 63 65 2c 20 | 74 68 65 6e 20 64 79 6e |source, |then dyn|
|000001d0| 61 6d 69 63 61 6c 6c 79 | 20 62 69 6e 64 73 20 74 |amically| binds t|
|000001e0| 68 65 20 63 6f 6c 75 6d | 6e 73 20 61 6e 64 20 64 |he colum|ns and d|
|000001f0| 69 73 70 6c 61 79 73 20 | 74 68 65 20 72 65 73 75 |isplays |the resu|
|00000200| 6c 74 73 20 0a 69 6e 20 | 61 20 74 65 6d 70 6c 61 |lts .in |a templa|
|00000210| 74 65 2e 20 49 20 68 61 | 76 65 20 74 77 6f 20 70 |te. I ha|ve two p|
|00000220| 72 6f 62 6c 65 6d 73 20 | 63 75 72 72 65 6e 74 6c |roblems |currentl|
|00000230| 79 3a 0a 0a 09 48 6f 77 | 20 64 6f 20 49 20 74 72 |y:...How| do I tr|
|00000240| 75 6e 63 61 74 65 20 74 | 68 65 20 64 61 74 61 20 |uncate t|he data |
|00000250| 69 6e 20 61 20 53 51 4c | 5f 54 49 4d 45 53 54 41 |in a SQL|_TIMESTA|
|00000260| 4d 50 20 66 69 65 6c 64 | 20 73 6f 20 74 68 61 74 |MP field| so that|
|00000270| 20 77 68 65 6e 20 49 0a | 64 69 73 70 6c 61 79 20 | when I.|display |
|00000280| 69 74 2c 20 74 68 65 20 | 66 69 65 6c 64 20 73 68 |it, the |field sh|
|00000290| 6f 77 73 20 6f 6e 6c 79 | 20 74 68 65 20 64 61 74 |ows only| the dat|
|000002a0| 65 20 70 6f 72 74 69 6f | 6e 3f 20 48 65 72 65 20 |e portio|n? Here |
|000002b0| 69 73 20 61 20 73 6e 69 | 70 70 65 74 20 6f 66 20 |is a sni|ppet of |
|000002c0| 63 6f 64 65 3a 0a 0a 63 | 61 73 65 20 53 51 4c 5f |code:..c|ase SQL_|
|000002d0| 54 49 4d 45 53 54 41 4d | 50 3a 0a 64 61 74 61 5b |TIMESTAM|P:.data[|
|000002e0| 69 5d 20 3d 20 6e 65 77 | 20 55 43 48 41 52 5b 32 |i] = new| UCHAR[2|
|000002f0| 34 5d 3b 0a 72 63 20 3d | 20 53 51 4c 42 69 6e 64 |4];.rc =| SQLBind|
|00000300| 43 6f 6c 28 68 73 74 6d | 74 2c 20 69 2b 31 2c 20 |Col(hstm|t, i+1, |
|00000310| 53 51 4c 5f 43 5f 43 48 | 41 52 2c 20 64 61 74 61 |SQL_C_CH|AR, data|
|00000320| 5b 69 5d 2c 20 32 34 2c | 20 26 6f 75 74 6c 65 6e |[i], 24,| &outlen|
|00000330| 5b 69 5d 29 3b 0a 62 72 | 65 61 6b 3b 0a 0a 49 6e |[i]);.br|eak;..In|
|00000340| 74 65 72 65 73 74 69 6e | 67 6c 79 20 69 74 20 64 |terestin|gly it d|
|00000350| 6f 65 73 6e 27 74 20 6d | 61 74 74 65 72 20 68 6f |oesn't m|atter ho|
|00000360| 77 20 6d 75 63 68 20 73 | 70 61 63 65 20 49 20 61 |w much s|pace I a|
|00000370| 6c 6c 6f 63 61 74 65 20 | 69 6e 20 6d 79 20 6e 65 |llocate |in my ne|
|00000380| 77 20 55 43 48 41 52 20 | 0a 6c 69 6e 65 2c 20 62 |w UCHAR |.line, b|
|00000390| 75 74 20 69 66 20 49 20 | 63 68 61 6e 67 65 20 74 |ut if I |change t|
|000003a0| 68 65 20 32 34 20 69 6e | 20 74 68 65 20 53 51 4c |he 24 in| the SQL|
|000003b0| 42 69 6e 64 43 6f 6c 2c | 20 49 20 67 65 74 20 73 |BindCol,| I get s|
|000003c0| 74 72 61 6e 67 65 20 65 | 72 72 6f 72 73 2e 0a 0a |trange e|rrors...|
|000003d0| 09 0a 09 4d 79 20 73 65 | 63 6f 6e 64 20 71 75 65 |...My se|cond que|
|000003e0| 73 74 69 6f 6e 20 69 73 | 20 69 66 20 61 20 75 73 |stion is| if a us|
|000003f0| 65 72 20 65 6e 74 65 72 | 73 20 61 20 71 75 65 72 |er enter|s a quer|
|00000400| 79 20 74 68 61 74 20 69 | 73 20 6d 61 64 65 20 6f |y that i|s made o|
|00000410| 66 20 74 77 6f 20 0a 64 | 69 73 74 69 6e 63 74 20 |f two .d|istinct |
|00000420| 71 75 65 72 69 65 73 20 | 69 65 2e 0a 0a 09 44 65 |queries |ie....De|
|00000430| 6c 65 74 65 20 66 72 6f | 6d 20 74 61 62 6c 65 20 |lete fro|m table |
|00000440| 77 68 65 72 65 20 75 73 | 65 72 3d 27 73 6d 69 74 |where us|er='smit|
|00000450| 68 27 20 53 65 6c 65 63 | 74 20 2a 20 66 72 6f 6d |h' Selec|t * from|
|00000460| 20 74 61 62 6c 65 0a 0a | 68 6f 77 20 64 6f 20 49 | table..|how do I|
|00000470| 20 66 65 74 63 68 20 6f | 6e 6c 79 20 74 68 65 20 | fetch o|nly the |
|00000480| 72 65 73 75 6c 74 73 20 | 66 72 6f 6d 20 74 68 65 |results |from the|
|00000490| 20 76 61 6c 69 64 20 53 | 45 4c 45 43 54 20 73 74 | valid S|ELECT st|
|000004a0| 61 74 65 6d 65 6e 74 3f | 0a 0a 54 68 61 6e 6b 73 |atement?|..Thanks|
|000004b0| 2c 0a 0a 4d 61 74 74 68 | 65 77 40 69 61 70 70 73 |,..Matth|ew@iapps|
|000004c0| 2e 63 6f 6d 0a 0a | |.com.. | |
+--------+-------------------------+-------------------------+--------+--------+